package com.ghosthigh.simpleaccount.client.common;

import com.ghosthigh.simpleaccount.client.common.model.UserInfo;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.AnchorElement;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class HeaderViewImpl<AdditionalLinkList> extends Composite implements
    HeaderView<AdditionalLinkList> {

  @SuppressWarnings("rawtypes")
  @UiTemplate("ui/HeaderViewImpl.ui.xml")
  interface HeaderViewImplBinder extends UiBinder<Widget, HeaderViewImpl> {}
  private static HeaderViewImplBinder uiBinder = GWT.create(HeaderViewImplBinder.class);

  @UiField AnchorElement userInfoEle;
  @UiField SpanElement headerTitle;
  @UiField AnchorElement logout;


  public HeaderViewImpl() {
    initWidget(uiBinder.createAndBindUi(this));
  }

  @Override
  public void setHeader(String text) {
    headerTitle.setInnerText(text);
  }

  @Override
  public void setUserInfo(UserInfo<AdditionalLinkList> userInfo) {
    userInfoEle.setInnerText(userInfo.getDisplayedName());
  }

  @Override
  public void setHandler(
      com.ghosthigh.simpleaccount.client.common.HeaderView.HeaderViewHandler handler) {
    // TODO Auto-generated method stub

  }

  @Override
  public String getHeader() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public UserInfo<AdditionalLinkList> getUserInfo() {
    // TODO Auto-generated method stub
    return null;
  }

}
